package IO;

import java.io.File;
import java.io.IOException;

//获取绝对路径
public class GetAbsolutPath {
    public static void main(String[] args) throws IOException {
        File f1 = new File("D:\\..\\.\\..\\.\\桌面文件\\java课程\\课程资料\\javaweb\\a.txt");
        String absolutePath = f1.getAbsolutePath();
        String canonicalPath = f1.getCanonicalPath();
        System.out.println(absolutePath);
        System.out.println(canonicalPath);
    }
}